<admintpl file="header" />
</head>
<body>
<div class="wrap">
    <ul class="nav nav-tabs">
        <li class="active"><a>不借列表</a></li>
    </ul>
    <form class="well form-search" method="post" action="{:U('Indexadmin/unwanted_user')}" style='line-height: 46px;'>
        手机号码：
        <input type="text" name="mobile" style="width: 150px;" value="{:I('request.mobile')}" placeholder="请输入手机号码">
        姓名：
        <input type="text" name="name" style="width: 150px;" value="{:I('request.name')}" placeholder="姓名">
        身份证：<input type="text" name="identity" style="width: 150px;" value="{:I('request.identity')}" placeholder="身份证">
        注册日期：<input class="js-date" type="text" name="starts" style="width: 150px;" value="{:I('request.starts')}" placeholder="起始时间">
        <input class="js-date" type="text" name="ends" style="width: 150px;" value="{:I('request.ends')}" placeholder="结束时间">
        <br />
        资料审核状态：<select name="type">
        <option value="">全部</option>
        <php>$tpl_selected=I('request.type')=='0'?"selected":"";</php>
        <option {$tpl_selected} value="0">待绑卡</option>
        <php>$tpl_selected=I('request.type')=='1'?"selected":"";</php>
        <option {$tpl_selected} value="1">上传证件照</option>
        <php>$tpl_selected=I('request.type')=='2'?"selected":"";</php>
        <option {$tpl_selected} value="2">待审核</option>
        <php>$tpl_selected=I('request.type')=='3'?"selected":"";</php>
        <option {$tpl_selected} value="3">学信认证</option>
        <php>$tpl_selected=I('request.type')=='4'?"selected":"";</php>
        <option {$tpl_selected} value="4">填写联系信息</option>
        <php>$tpl_selected=I('request.type')=='5'?"selected":"";</php>
        <option {$tpl_selected} value="5">信息填写完成</option>
        <php>$tpl_selected=I('request.type')=='8'?"selected":"";</php>
        <option {$tpl_selected} value="8">系统审核不通过</option>
    </select>
        借款状态：<select name="type_borr">
        <option value="">全部</option>
        <php>$tpl_selected=I('request.type_borr')=='0'?"selected":"";</php>
        <option {$tpl_selected} value="0">待申请借款</option>
        <php>$tpl_selected=I('request.type_borr')=='1'?"selected":"";</php>
        <option {$tpl_selected} value="1">待填写运营商信息</option>
        <php>$tpl_selected=I('request.type_borr')=='2'?"selected":"";</php>
        <option {$tpl_selected} value="2">借款中</option>
        <php>$tpl_selected=I('request.type_borr')=='3'?"selected":"";</php>
        <option {$tpl_selected} value="3">不通过</option>
		</select>
		芝麻分：<input type="number" name="starts_zmf" style="width: 150px;" value="{:I('request.starts_zmf')}" placeholder="大于多少芝麻分">
			<input type="number" name="ends_zmf" style="width: 150px;" value="{:I('request.ends_zmf')}" placeholder="小于多少芝麻分">
		<br/>
		客户类型：
		<select name="is_adult">
			<option value="-1">全部</option>
			<php>$tpl_selected=I('request.is_adult')=='0'?"selected":"";</php>
			<option {$tpl_selected} value="0">未知</option>
			<php>$tpl_selected=I('request.is_adult')=='1'?"selected":"";</php>
			<option {$tpl_selected} value="1">成人</option>
			<php>$tpl_selected=I('request.is_adult')=='2'?"selected":"";</php>
			<option {$tpl_selected} value="2">学生</option>
		</select>
		借款次数：<select name="ordnum">
				<option value="0">全部</option>
				<php>$tpl_selected=I('request.ordnum')=='1'?"selected":"";</php>
				<option {$tpl_selected} value="1">初次</option>
				<php>$tpl_selected=I('request.ordnum')=='2'?"selected":"";</php>
				<option {$tpl_selected} value="2">续借(不续借的客户)</option>
				</select>
        客户类型：
        <select name="is_adult">
            <option value="-1">全部</option>
            <php>$tpl_selected=I('request.is_adult')=='0'?"selected":"";</php>
            <option {$tpl_selected} value="0">未知</option>
            <php>$tpl_selected=I('request.is_adult')=='1'?"selected":"";</php>
            <option {$tpl_selected} value="1">成人</option>
            <php>$tpl_selected=I('request.is_adult')=='2'?"selected":"";</php>
            <option {$tpl_selected} value="2">学生</option>
        </select>
        <input type="hidden" name="byusers" value="3">
        <input type="submit" class="btn btn-primary" value="搜索" />
        <a class="btn btn-danger" href="{:U('Indexadmin/reflux_user')}">清空</a>
        <button class="btn btn-primary js-ajax-submit" type="button" id='add_bate2' data-action="{:U('indexadmin/batch_update_reflux2normal')}" onclick='check(1)' >
            批量添加正常用户
        </button>
		<a class="btn btn-primary" id='export_btn' href="{:U('indexadmin/export_app_user',array('wheres'=>$wheres_str))}" >导出</a>
    </form>
    <form method="post" class="js-ajax-form">
        <table class="table table-hover table-bordered" id='tab_check'>
            <thead>
            <tr>

                <th style='min-width: 30px;' align="center">选择</th>

                <th style='width: 66px;'>{:L('REGISTRATION_TIME')}</th>

                <th style='min-width: 50px;'>{:L('NICENAME')}</th>
                <th style='min-width: 50px;'>芝麻分</th>
                <th style='min-width: 50px;'>客户类型</th>
                <th style='min-width: 60px;'>{:L('USER_INFO')}</th>
                <th style='min-width: 50px;'>{:L('LOAN_INFO')}</th>
                <th style='min-width: 50px;'>{:L('IDENTITY')}</th>
                <!-- <th style='min-width: 50px;'>{:L('LAST_LOGIN_TIME')}</th> -->
                <th style='min-width: 50px;'>负责专员</th>
                <th style='min-width: 50px;'>借款次数</th>
                <th style='min-width: 50px;'>手机</th>

                <th style='width: 35px;'>学历</th>

                <!-- <th style='min-width: 50px;'>实名认证状态</th> -->
                <th style='min-width: 50px;'>资料认证状态</th>
                <th style='min-width: 50px;'>分销类型</th>
                <th>渠道来源</th>
                <th>推荐码</th>
                <th  style='min-width: 50px;' align="center">{:L('ACTIONS')}</th>
            </tr>
            </thead>
            <tbody>
            <php>$user_statuses=array("0"=>L('USER_STATUS_BLOCKED'),"1"=>L('USER_STATUS_ACTIVATED'),"2"=>L('USER_STATUS_UNVERIFIED'));</php>
            <foreach name="list" item="vo" key="k">
                <tr>
                    <td><input type='checkbox' name='id[]' value='{$vo.id}'/></td>
                    <!--<td><input type='checkbox' name='id[]' value='{$vo.id}'/></td>-->
                    <td>{$vo.crtime}</td>
                    <td>{$vo['name']?$vo['name']:L('NOT_FILLED')}</td>
					<td>{$vo.sesame_score}</td>
					<td>
					<if condition="($vo.is_adult eq 0)"> 未知
						<elseif condition="$vo.is_adult eq 1"/>成人
						<elseif condition="$vo.is_adult eq 2"/>学生
					</if>
					</td>
                    <td>
                        <if condition="($vo.type eq 0)"> 待绑卡
                            <elseif condition="$vo.type eq 1"/>上传证件照
                            <elseif condition="$vo.type eq 2"/>待审核
                            <elseif condition="$vo.type eq 3"/>学信认证
                            <elseif condition="$vo.type eq 4"/>填写联系信息
                            <elseif condition="$vo.type eq 5" /> 信息填写完成
                            <elseif condition="$vo.type eq 8" />系统审核不通过
                        </if></td>
                    <td><if condition="($vo.type_borr eq 0)">待申请借款
                        <elseif condition="$vo.type_borr eq 1"/>待填写运营商
                        <elseif condition="$vo.type_borr eq 2"/>借款中
                        <elseif condition="$vo.type_borr eq 3"/>审核不通过
						<elseif condition="$vo.type_borr eq 4"/>已提额待激活
                    </if></td>
                    <if condition="($group eq 6)">
                        <td>{$vo['identity']}</td>
                        <else/>
                        <php>$iden=substr($vo['identity'],6,8)</php>
                        <td>{$iden}</td>
                    </if>
                    <!-- <td>{$vo.last_login_time}</td> -->
                    <td>{$buyers[$vo['byusers']]}</td>
					<td>{$vo['renew']=='1'?'续借':'初次'}</td>
                    <td>{$vo['photo_type']==1?'苹果':'安卓'}</td>
                    <td>{$vo.education}</td>
                    <php>$ds=array('0'=>'<span style="color:red">未认证</span>','1'=>'<span style="color:green">已认证</span>','2'=>'<span style="color:red">认证未通过</span>','3'=>'<span style="color:red">暂时不需要</span>')</php>
                    <!-- <td>{$ds[$vo['silver_stutas']]}</td> -->
                    <td>{$ds[$vo['account_status']]}</td>
                    <!-- <td>{$user_statuses[$vo['user_status']]}</td> -->
                    <td>{$vo['is_dis']==1?'推广':'正常'}</td>
                    <td>{$codes[$vo['code']]|default=''}</td>
                    <td>{$is_dis[$vo['id']]}</td>
                    <td align="center">
                        <a href="{:U('indexadmin/see',array('id'=>$vo['id'],'from_type'=>5))}">客户详情</a>
						 <if condition="($group neq 6)">
							|<a href="{:U('indexadmin/info',array('id'=>$vo['id'],'dis'=>1))}" >{:L('MOD')}</a>
							<eq name="vo.account_status" value="0">
								<if condition="($vo.silver_stutas eq 0) or ($vo.silver_stutas eq 2)">
								<!-- <br />|<a href="{:U('indexadmin/examine',array('id'=>$vo['id']))}">实名认证</a> -->
								</if>
								<if condition="($vo.silver_stutas eq 1)">
								
								</if>
							</eq>	
							<if condition="($vo.type_borr eq 1) and ($vo.byusers neq 0)" >
									<br />|<a class="js-ajax-dialog-btn" data-msg="确定 {$vo['name']} 跳过系统认证?" href="{:U('indexadmin/type_exam',array('id'=>$vo['id']))}">跳过系统认证</a>				
							</if>
							<eq name="vo.type" value="5">
								<if condition="($vo.type_borr eq 1)">
								<br />|<a href="{:U('indexadmin/jum_ban',array('id'=>$vo['id']))}" class="js-ajax-dialog-btn" data-msg="确定 {$vo['name']} 跳过运营商验证?">跳过运营商验证</a>
								</if>
							</eq>
						</if>
                        <br />| <a href="{:U('indexadmin/operator_remark',['id'=>$vo['id']])}">运营备注</a>
					</td>
                </tr>
            </foreach>
            </tbody>
        </table>
        <div class="pagination">{$page}</div>
    </form>
</div>
<div id="dialog" style='display:none' >
    <p>请选择转让的审核专员</p>
    <ul style='width: 500px;list-style-type:none;'>
        <php>$i=0;</php>
        <foreach name="shen_user" item="vo">
            <li style='width: 110px;float: left;'><input type="radio" name='us_id' value='{$vo.id}' style='margin: 0 0 0 10px;'/>{$vo.user_login}</li>
            <php>$i++;</php>
            <if condition="($i eq 4)"><br/>
                <php>$i=0;</php>
            </if>
        </foreach>
    </ul>
</div>
<script src="__PUBLIC__/js/common.js"></script>
<script>
    function check(type){
        var btn;
        if(1==type){
            btn = $('button.js-ajax-submit').eq(0);
        }else if(2==type){
            btn = $('button.js-ajax-submit').eq(1);
        }
        form = $('form.js-ajax-form');
        var obj=document.getElementsByName('id[]');
        var s=0;
        for(var i=0; i<obj.length; i++){
            if(obj[i].checked) s+=1;
        }
        if(s==0){
            alert('请选择客户');
            return ;
        }
        form.ajaxSubmit({
            url: type ? btn.data('action') : form.attr('action'),
            //按钮上是否自定义提交地址(多按钮情况)
            dataType: 'json',
            beforeSubmit: function (arr, $form, options) {
                var tx='批量添加';
                //按钮文案、状态修改
                btn.text(tx + '中...').attr('disabled', true).addClass('disabled');
            },
            success: function (data, statusText, xhr, $form) {
                //按钮文案、状态修改
                btn.removeClass('disabled').parent().find('span').remove();

                if (data.state === 'success') {
                    $('<span class="tips_success">' + data.info + '</span>').appendTo(btn.parent()).fadeIn('slow').delay(1000).fadeOut(function () {
                        if (data.referer) {
                            //返回带跳转地址
                            if (window.parent.art) {
                                //iframe弹出页
                                window.parent.location.href = data.referer;
                            } else {
                                window.location.href = data.referer;
                            }
                        } else {
                            if (window.parent.art) {
                                if(1==type){
                                    reloadPage(window.parent);
                                }else if(2==type){
                                    window.location.reload();
                                }
                            } else {
                                //刷新当前页
                                reloadPage(window);
                            }
                        }
                    });
                } else if (data.state === 'fail') {
                    $('<span class="tips_error">' + data.info + '</span>').appendTo(btn.parent()).fadeIn('fast');
                    btn.removeProp('disabled').removeClass('disabled');
                }
            }
        });
    }
    function trf(){
        var btn = $('#trf_bate');
        form = $('form.js-ajax-form');
        var obj=document.getElementsByName('id[]');
        var s='';
        for(var i=0; i<obj.length; i++){
            if(obj[i].checked){
                if(s==''){
                    s=obj[i].value;
                }else{
                    s+=','+obj[i].value;
                }

            }
        }
        if(s==''){
            alert('请选择客户');
            return ;
        }
        href = btn.data('action'),
            href = href ? href : $this.attr('href');
        Wind.use('artDialog', function () {
            //document.getElementById("dialog").style.display='block';
            art.dialog({
                title: false,
                //icon: 'question',
                content: $("#dialog").html(),
                //content: '1111',
                follow: document.getElementById('trf_bate'),
                close: function () {
                    return true;
                },
                ok: function () {
                    var radio = document.getElementsByName("us_id");
                    var us_id=0;
                    for (i=0; i<radio.length; i++) {
                        if (radio[i].checked) {
                            us_id=radio[i].value;
                        }
                    }
                    if(us_id==0){
                        alert('请选择审核专员');
                        return false;
                    }
                    $.ajax({
                        url:href,
                        type:'post',
                        dataType:'json',
                        data:'users='+s+'&us_id='+us_id,
                        success:function(map){
                            if (map.state == 'success') {
                                art.dialog({
                                    content: map.info,
                                    icon: 'success',
                                    ok: function () {
                                        this.title(map.info);
                                        return true;
                                    }
                                });
                            } else if (map.state == 'fail') {
                                //art.dialog.alert(data.info);
                                //alert(data.info);//暂时处理方案
                                art.dialog({
                                    content: map.info,
                                    icon: 'warning',
                                    ok: function () {
                                        this.title(map.info);
                                        return true;
                                    }
                                });
                            }
                        }

                    });
                },
                cancelVal: '关闭',
                cancel: true
            });
        });

    }
</script>
</body>
</html>